package com.yuanfeng.web;

import java.util.Map;

import org.apache.struts2.interceptor.ApplicationAware;
import org.apache.struts2.interceptor.RequestAware;
import org.apache.struts2.interceptor.SessionAware;

import com.yuanfeng.service.ICustomerService;
import com.yuanfeng.service.IDepartmentService;
import com.yuanfeng.service.IEmployeeService;
import com.yuanfeng.service.ITraceHistoryService;
import com.yuanfeng.service.ITransferHistoryService;

import com.opensymphony.xwork2.ActionSupport;

/**
 * BaseAction, 
 * 	1. 所有的表示域的map在接收接收
 *  2. 所有的Service，都在这里接收IOC容器注入结果
 * @author AdminTH
 *
 */
public class BaseAction extends ActionSupport implements RequestAware,SessionAware,ApplicationAware{

	// map
	protected Map<String, Object> request;	// 保存struts在运行时期注入的表示request的map
	protected Map<String, Object> session;	// 保存struts在运行时期注入的表示session的map
	protected Map<String, Object> application;	// 保存struts在运行时期注入的表示application的map
	
	// Service
	// 注入Service对象
	protected IDepartmentService departmentService;		// 部门
	protected IEmployeeService employeeService;			// 营销人员
	protected ICustomerService customerService;			// 客户
	protected ITraceHistoryService traceHistoryService;	// 客户跟进
	protected ITransferHistoryService transferHistoryService;	// 客户移交
	
	
	public void setTransferHistoryService(
			ITransferHistoryService transferHistoryService) {
		this.transferHistoryService = transferHistoryService;
	}
	public void setTraceHistoryService(ITraceHistoryService traceHistoryService) {
		this.traceHistoryService = traceHistoryService;
	}
	public void setCustomerService(ICustomerService customerService) {
		this.customerService = customerService;
	}
	public void setEmployeeService(IEmployeeService employeeService) {
		this.employeeService = employeeService;
	}
	public void setDepartmentService(IDepartmentService departmentService) {
		this.departmentService = departmentService;
	}
	
	
	public void setRequest(Map<String, Object> request) {
		this.request = request;
	}
	public void setSession(Map<String, Object> session) {
		this.session = session;
	}
	public void setApplication(Map<String, Object> application) {
		this.application = application;
	}

}
